﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EIA.PM.Model;
using EIA.PM.BLL.ClientProxy;

namespace EIA.WCFService.PM.SilverlightTest
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            TRoleProxy roleProxy = new TRoleProxy();
            roleProxy.Count(null, (n) => {
                if (n == 0)
                {
                    List<TRole> roles = new List<TRole>();
                    roles.Add(new TRole(0, "管理员", ""));
                    roles.Add(new TRole(0, "普通用户", ""));
                    roleProxy.InsertList(roles, (ks) => { 
                    });

                }
            
            });
            System.Threading.Thread.Sleep(1000);
            roleProxy.List(null, 10, 1, (lst) =>
            {
                MessageBox.Show(Newtonsoft.Json.JsonConvert.SerializeObject(lst));
            });
        }
    }
}
